www.gusucode.com > VC 2D游戏编辑器-源码程序 > VC 2D游戏编辑器-源码程序/code/mapedit_source/dialog/zoretic.cpp

    //Download by http://www.NewXing.com
// cpp : implementation file
//

#include "stdafx.h"
#include "..\\MapEdit.h"
#include "zoretic.h"
#include "..\\map\\map.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


extern 	_ZoeticLink*	pZoeticLink1;
extern SKILL 	skill[Max_SKILL_NPC];							//技能
extern GOODS 	medica_goods[Max_GOODS_NPC];					//物品
extern WORD  	equiped[6];
/////////////////////////////////////////////////////////////////////////////
// Czoretic dialog


Czoretic::Czoretic(CWnd* pParent /*=NULL*/)
	: CDialog(Czoretic::IDD, pParent)
{
	//{{AFX_DATA_INIT(Czoretic)
	m_area = 0;
	m_maxexp = 0;
	m_money = 0;
	m_x = 0;
	m_y = 0;
	m_agility_used = TRUE;
	m_area_used = TRUE;
	m_attack_used = TRUE;
	m_character_used = TRUE;
	m_defend_used = TRUE;
	m_energy_used = TRUE;
	m_equip_used = TRUE;
	m_event_used = TRUE;
	m_follow_used = TRUE;
	m_goods_used = TRUE;
	m_life_used = TRUE;
	m_maxexp_used = TRUE;
	m_maxenergy_used = TRUE;
	m_maxlife_used = TRUE;
	m_maxvigor_used = TRUE;
	m_money_used = TRUE;
	m_pic_used = TRUE;
	m_skill_used = TRUE;
	m_speed_used = TRUE;
	m_type_used = TRUE;
	m_v_used = TRUE;
	m_vigor_used = TRUE;
	m_x_used = FALSE;
	m_y_used = FALSE;
	m_event = 0;
	m_follow = 0;
	m_agility = 0;
	m_attack = 0;
	m_character = 0;
	m_defend = 0;
	m_energy = 0;
	m_equip_id = 0;
	m_goods_id = 0;
	m_goods_number = 0;
	m_life = 0;
	m_maxenergy = 0;
	m_maxlife = 0;
	m_maxvigor = 0;
	m_pic = 0;
	m_skill_id = 0;
	m_skill_level = 0;
	m_speed = 0;
	m_type = 0;
	m_v = 0;
	m_vigor = 0;
	m_name = _T("");
	m_name_used = TRUE;
	m_id = _T("");
	//}}AFX_DATA_INIT
}


void Czoretic::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Czoretic)
	DDX_Control(pDX, IDC_ZOETIC_EQUIP_ID, m_equip_id_control);
	DDX_Control(pDX, IDC_ZOETIC_GOODS_NUMBER, m_goods_number_control);
	DDX_Control(pDX, IDC_ZOETIC_GOODS_ID, m_goods_id_control);
	DDX_Control(pDX, IDC_ZOETIC_SKILL_LEVEL, m_skill_level_control);
	DDX_Control(pDX, IDC_ZOETIC_SKILL_ID, m_skill_id_control);
	DDX_Control(pDX, IDC_ZOETIC_SKILL, m_skill);
	DDX_Control(pDX, IDC_ZOETIC_GOODS, m_goods);
	DDX_Control(pDX, IDC_ZOETIC_EQUIP, m_equip);
	DDX_Text(pDX, IDC_ZOETIC_AREA, m_area);
	DDV_MinMaxInt(pDX, m_area, 0, 1023);
	DDX_Text(pDX, IDC_ZOETIC_MAXEXP, m_maxexp);
	DDV_MinMaxInt(pDX, m_maxexp, 0, 1000000);
	DDX_Text(pDX, IDC_ZOETIC_MONEY, m_money);
	DDV_MinMaxInt(pDX, m_money, 0, 999999);
	DDX_Text(pDX, IDC_ZOETIC_X, m_x);
	DDV_MinMaxInt(pDX, m_x, 0, 1023);
	DDX_Text(pDX, IDC_ZOETIC_Y, m_y);
	DDV_MinMaxInt(pDX, m_y, 0, 1023);
	DDX_Check(pDX, IDC_ZOETIC_AGILITY_USED, m_agility_used);
	DDX_Check(pDX, IDC_ZOETIC_AREA_USED, m_area_used);
	DDX_Check(pDX, IDC_ZOETIC_ATTACK_USED, m_attack_used);
	DDX_Check(pDX, IDC_ZOETIC_CHARACTER_USED, m_character_used);
	DDX_Check(pDX, IDC_ZOETIC_DEFEND_USED, m_defend_used);
	DDX_Check(pDX, IDC_ZOETIC_ENERGY_USED, m_energy_used);
	DDX_Check(pDX, IDC_ZOETIC_EQUIP_USED, m_equip_used);
	DDX_Check(pDX, IDC_ZOETIC_EVENT_USED, m_event_used);
	DDX_Check(pDX, IDC_ZOETIC_FOLLOW_USED, m_follow_used);
	DDX_Check(pDX, IDC_ZOETIC_GOODS_USED, m_goods_used);
	DDX_Check(pDX, IDC_ZOETIC_LIFE_USED, m_life_used);
	DDX_Check(pDX, IDC_ZOETIC_MAX_EXP_USED, m_maxexp_used);
	DDX_Check(pDX, IDC_ZOETIC_MAXENERGY_USED, m_maxenergy_used);
	DDX_Check(pDX, IDC_ZOETIC_MAXLIFE_USED, m_maxlife_used);
	DDX_Check(pDX, IDC_ZOETIC_MAXVIGOR_USED, m_maxvigor_used);
	DDX_Check(pDX, IDC_ZOETIC_MONEY_USED, m_money_used);
	DDX_Check(pDX, IDC_ZOETIC_PIC_USED, m_pic_used);
	DDX_Check(pDX, IDC_ZOETIC_SKILL_USED, m_skill_used);
	DDX_Check(pDX, IDC_ZOETIC_SPEED_USED, m_speed_used);
	DDX_Check(pDX, IDC_ZOETIC_TYPE_USED, m_type_used);
	DDX_Check(pDX, IDC_ZOETIC_V_USED, m_v_used);
	DDX_Check(pDX, IDC_ZOETIC_VIGOR_USED, m_vigor_used);
	DDX_Check(pDX, IDC_ZOETIC_X_USED, m_x_used);
	DDX_Check(pDX, IDC_ZOETIC_Y_USED, m_y_used);
	DDX_Text(pDX, IDC_ZOETIC_EVENT, m_event);
	DDV_MinMaxInt(pDX, m_event, -1, 100);
	DDX_Text(pDX, IDC_ZOETIC_FOLLOW, m_follow);
	DDV_MinMaxInt(pDX, m_follow, -1, 1000);
	DDX_Text(pDX, IDC_ZOETIC_AGILITY, m_agility);
	DDV_MinMaxInt(pDX, m_agility, 0, 9999);
	DDX_Text(pDX, IDC_ZOETIC_ATTACK, m_attack);
	DDV_MinMaxInt(pDX, m_attack, 1, 9999);
	DDX_Text(pDX, IDC_ZOETIC_CHARACTER, m_character);
	DDV_MinMaxInt(pDX, m_character, 0, 100);
	DDX_Text(pDX, IDC_ZOETIC_DEFEND, m_defend);
	DDV_MinMaxInt(pDX, m_defend, 0, 9999);
	DDX_Text(pDX, IDC_ZOETIC_ENERGY, m_energy);
	DDV_MinMaxInt(pDX, m_energy, 0, 9999);
	DDX_Text(pDX, IDC_ZOETIC_EQUIP_ID, m_equip_id);
	DDV_MinMaxInt(pDX, m_equip_id, -1, 9999);
	DDX_Text(pDX, IDC_ZOETIC_GOODS_ID, m_goods_id);
	DDV_MinMaxInt(pDX, m_goods_id, -1, 9999);
	DDX_Text(pDX, IDC_ZOETIC_GOODS_NUMBER, m_goods_number);
	DDV_MinMaxInt(pDX, m_goods_number, 0, 1000);
	DDX_Text(pDX, IDC_ZOETIC_LIFE, m_life);
	DDV_MinMaxInt(pDX, m_life, 0, 9999);
	DDX_Text(pDX, IDC_ZOETIC_MAXENERGY, m_maxenergy);
	DDV_MinMaxInt(pDX, m_maxenergy, 20, 9999);
	DDX_Text(pDX, IDC_ZOETIC_MAXLIFE, m_maxlife);
	DDV_MinMaxInt(pDX, m_maxlife, 20, 9999);
	DDX_Text(pDX, IDC_ZOETIC_MAXVIGOR, m_maxvigor);
	DDV_MinMaxInt(pDX, m_maxvigor, 20, 9999);
	DDX_Text(pDX, IDC_ZOETIC_PIC, m_pic);
	DDV_MinMaxInt(pDX, m_pic, 0, 100);
	DDX_Text(pDX, IDC_ZOETIC_SKILL_ID, m_skill_id);
	DDV_MinMaxInt(pDX, m_skill_id, -1, 9999);
	DDX_Text(pDX, IDC_ZOETIC_SKILL_LEVEL, m_skill_level);
	DDV_MinMaxInt(pDX, m_skill_level, 0, 99);
	DDX_Text(pDX, IDC_ZOETIC_SPEED, m_speed);
	DDV_MinMaxInt(pDX, m_speed, 3, 100);
	DDX_Text(pDX, IDC_ZOETIC_TYPE, m_type);
	DDV_MinMaxInt(pDX, m_type, 0, 9999);
	DDX_Text(pDX, IDC_ZOETIC_V, m_v);
	DDV_MinMaxInt(pDX, m_v, 0, 100);
	DDX_Text(pDX, IDC_ZOETIC_VIGOR, m_vigor);
	DDV_MinMaxInt(pDX, m_vigor, 0, 9999);
	DDX_Text(pDX, IDC_ZOETIC_NAME, m_name);
	DDV_MaxChars(pDX, m_name, 40);
	DDX_Check(pDX, IDC_ZOETIC_NAME_USED, m_name_used);
	DDX_Text(pDX, IDC_ZOETIC_ID, m_id);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Czoretic, CDialog)
	//{{AFX_MSG_MAP(Czoretic)
	ON_BN_CLICKED(IDC_ZOETIC_TYPE_USED, OnZoeticTypeUsed)
	ON_BN_CLICKED(IDC_ZOETIC_MAX_EXP_USED, OnZoeticMaxExpUsed)
	ON_BN_CLICKED(IDC_ZOETIC_PIC_USED, OnZoeticPicUsed)
	ON_BN_CLICKED(IDC_ZOETIC_X_USED, OnZoeticXUsed)
	ON_BN_CLICKED(IDC_ZOETIC_Y_USED, OnZoeticYUsed)
	ON_BN_CLICKED(IDC_ZOETIC_EVENT_USED, OnZoeticEventUsed)
	ON_BN_CLICKED(IDC_ZOETIC_AREA_USED, OnZoeticAreaUsed)
	ON_BN_CLICKED(IDC_ZOETIC_CHARACTER_USED, OnZoeticCharacterUsed)
	ON_BN_CLICKED(IDC_ZOETIC_AGILITY_USED, OnZoeticAgilityUsed)
	ON_BN_CLICKED(IDC_ZOETIC_LIFE_USED, OnZoeticLifeUsed)
	ON_BN_CLICKED(IDC_ZOETIC_MAXLIFE_USED, OnZoeticMaxlifeUsed)
	ON_BN_CLICKED(IDC_ZOETIC_VIGOR_USED, OnZoeticVigorUsed)
	ON_BN_CLICKED(IDC_ZOETIC_MAXVIGOR_USED, OnZoeticMaxvigorUsed)
	ON_BN_CLICKED(IDC_ZOETIC_ENERGY_USED, OnZoeticEnergyUsed)
	ON_BN_CLICKED(IDC_ZOETIC_MAXENERGY_USED, OnZoeticMaxenergyUsed)
	ON_BN_CLICKED(IDC_ZOETIC_ATTACK_USED, OnZoeticAttackUsed)
	ON_BN_CLICKED(IDC_ZOETIC_DEFEND_USED, OnZoeticDefendUsed)
	ON_BN_CLICKED(IDC_ZOETIC_V_USED, OnZoeticVUsed)
	ON_BN_CLICKED(IDC_ZOETIC_SPEED_USED, OnZoeticSpeedUsed)
	ON_BN_CLICKED(IDC_ZOETIC_FOLLOW_USED, OnZoeticFollowUsed)
	ON_BN_CLICKED(IDC_ZOETIC_MONEY_USED, OnZoeticMoneyUsed)
	ON_BN_CLICKED(IDC_ZOETIC_SKILL_USED, OnZoeticSkillUsed)
	ON_BN_CLICKED(IDC_ZOETIC_GOODS_USED, OnZoeticGoodsUsed)
	ON_BN_CLICKED(IDC_ZOETIC_EQUIP_USED, OnZoeticEquipUsed)
	ON_CBN_CLOSEUP(IDC_ZOETIC_SKILL, OnCloseupZoeticSkill)
	ON_CBN_CLOSEUP(IDC_ZOETIC_GOODS, OnCloseupZoeticGoods)
	ON_CBN_CLOSEUP(IDC_ZOETIC_EQUIP, OnCloseupZoeticEquip)
	ON_CBN_DROPDOWN(IDC_ZOETIC_SKILL, OnDropdownZoeticSkill)
	ON_CBN_DROPDOWN(IDC_ZOETIC_GOODS, OnDropdownZoeticGoods)
	ON_CBN_DROPDOWN(IDC_ZOETIC_EQUIP, OnDropdownZoeticEquip)
	ON_BN_CLICKED(IDC_ZOETIC_NAME_USED, OnZoeticNameUsed)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Czoretic message handlers

void Czoretic::OnZoeticTypeUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_TYPE)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_TYPE)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_TYPE_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_TYPE)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_TYPE_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticMaxExpUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_MAXEXP)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_MAXEXP)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_MAXEXP_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_MAXEXP)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_MAXEXP_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticPicUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_PIC)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_PIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_PIC_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_PIC)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_PIC_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticXUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_X)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_X)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_X_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_X)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_X_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticYUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_Y)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_Y)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_Y_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_Y)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_Y_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticEventUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_EVENT)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_EVENT)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_EVENT_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_EVENT)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_EVENT_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticAreaUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_AREA)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_AREA)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_AREA_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_AREA)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_AREA_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticCharacterUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_CHARACTER)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_CHARACTER)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_CHARACTER_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_CHARACTER)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_CHARACTER_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticAgilityUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_AGILITY)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_AGILITY)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_AGILITY_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_AGILITY)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_AGILITY_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticLifeUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_LIFE)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_LIFE)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_LIFE_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_LIFE)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_LIFE_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticMaxlifeUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_MAXLIFE)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_MAXLIFE)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_MAXLIFE_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_MAXLIFE)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_MAXLIFE_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticVigorUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_VIGOR)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_VIGOR)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_VIGOR_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_VIGOR)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_VIGOR_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticMaxvigorUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_MAXVIGOR)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_MAXVIGOR)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_MAXVIGOR_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_MAXVIGOR)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_MAXVIGOR_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticEnergyUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_ENERGY)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_ENERGY)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_ENERGY_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_ENERGY)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_ENERGY_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticMaxenergyUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_MAXENERGY)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_MAXENERGY)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_MAXENERGY_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_MAXENERGY)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_MAXENERGY_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticAttackUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_ATTACK)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_ATTACK)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_ATTACK_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_ATTACK)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_ATTACK_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticDefendUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_DEFEND)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_DEFEND)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_DEFEND_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_DEFEND)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_DEFEND_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticVUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_V)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_V)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_V_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_V)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_V_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticSpeedUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_SPEED)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_SPEED)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_SPEED_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_SPEED)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_SPEED_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticFollowUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_FOLLOW)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_FOLLOW)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_FOLLOW_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_FOLLOW)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_FOLLOW_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticMoneyUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_MONEY)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_MONEY)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_MONEY_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_MONEY)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_MONEY_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticSkillUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_SKILL)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_SKILL)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_SKILL_ID)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_SKILL_LEVEL)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_SKILL_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_SKILL_ID_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_SKILL_LEVEL_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_SKILL)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_SKILL_ID)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_SKILL_LEVEL)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_SKILL_STATIC)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_SKILL_ID_STATIC)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_SKILL_LEVEL_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnZoeticGoodsUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_GOODS)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_GOODS)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_ID)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_NUMBER)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_ID_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_NUMBER_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_GOODS)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_GOODS_ID)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_GOODS_NUMBER)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_GOODS_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_ID_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_GOODS_NUMBER_STATIC)->EnableWindow(FALSE);
	}
}

void Czoretic::OnZoeticEquipUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_EQUIP)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_EQUIP)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_EQUIP_ID)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_EQUIP_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_EQUIP_ID_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_EQUIP)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_EQUIP_ID)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_EQUIP_STATIC)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_EQUIP_ID_STATIC)->EnableWindow(FALSE);
	}
}

BOOL Czoretic::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	char str[10];

	GetDlgItem(IDC_ZOETIC_X_USED)->EnableWindow(FALSE);
	GetDlgItem(IDC_ZOETIC_Y_USED)->EnableWindow(FALSE);

	int i;

	for(i = 0; i < Max_SKILL_NPC; i++)
	{
		itoa(i, str, 5);
		m_skill.AddString(str);
		skill[i].id = pZoeticLink1->skill[i].id;
		skill[i].level = pZoeticLink1->skill[i].level;
	}
	m_skill.SetCurSel(0);
	m_skill_id	= pZoeticLink1->skill[0].id;
	m_skill_level	= pZoeticLink1->skill[0].level;

	for(i = 0; i < Max_GOODS_NPC; i++)
	{
		itoa(i, str, 5);
		m_goods.AddString(str);
		medica_goods[i].id = pZoeticLink1->medica_goods[i].id;
		medica_goods[i].iNumber = pZoeticLink1->medica_goods[i].iNumber;
	}
	m_goods.SetCurSel(0);
	m_goods_id	= pZoeticLink1->medica_goods[0].id;
	m_goods_number	= pZoeticLink1->medica_goods[0].iNumber;

	for(i = 0; i < 6; i++)
	{
		itoa(i, str, 10);
		m_equip.AddString(str);
		equiped[i] = pZoeticLink1->equiped[i];
	}
	m_equip.SetCurSel(0);
	m_equip_id	= pZoeticLink1->equiped[0];

	itoa(m_skill_id, str, 10);
	m_skill_id_control.SetWindowText(str);
	itoa(m_skill_level, str, 10);
	m_skill_level_control.SetWindowText(str);

	itoa(m_goods_id, str, 10);
	m_goods_id_control.SetWindowText(str);
	itoa(m_goods_number, str, 10);
	m_goods_number_control.SetWindowText(str);

	itoa(m_equip_id, str, 10);
	m_equip_id_control.SetWindowText(str);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void Czoretic::OnCloseupZoeticSkill() 
{
	// TODO: Add your control notification handler code here
	int iChoice;
	iChoice = m_skill.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_skill_id = skill[iChoice].id;
		m_skill_level = skill[iChoice].level;
	}
	char str[10];
	itoa(m_skill_id, str, 10);
	m_skill_id_control.SetWindowText(str);
	itoa(m_skill_level, str, 10);
	m_skill_level_control.SetWindowText(str);
}

void Czoretic::OnCloseupZoeticGoods() 
{
	// TODO: Add your control notification handler code here
	int iChoice;
	iChoice = m_goods.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_goods_id = medica_goods[iChoice].id;
		m_goods_number = medica_goods[iChoice].iNumber;
	}
	char str[10];
	itoa(m_goods_id, str, 10);
	m_goods_id_control.SetWindowText(str);
	itoa(m_goods_number, str, 10);
	m_goods_number_control.SetWindowText(str);
}

void Czoretic::OnCloseupZoeticEquip() 
{
	// TODO: Add your control notification handler code here
	int iChoice;
	iChoice = m_equip.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_equip_id = equiped[iChoice];
	}
	char str[10];
	itoa(m_equip_id, str, 10);
	m_equip_id_control.SetWindowText(str);
}

void Czoretic::OnDropdownZoeticSkill() 
{
	// TODO: Add your control notification handler code here
	int iChoice;
	char str[10];
	iChoice = m_skill.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_skill_id_control.GetWindowText(str, 10);
		skill[iChoice].id = atoi(str);
		m_skill_level_control.GetWindowText(str, 10);
		skill[iChoice].level = atoi(str);
	}
}

void Czoretic::OnDropdownZoeticGoods() 
{
	// TODO: Add your control notification handler code here
	int iChoice;
	char str[10];
	iChoice = m_goods.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_goods_id_control.GetWindowText(str, 10);
		medica_goods[iChoice].id = atoi(str);
		m_goods_number_control.GetWindowText(str, 10);
		medica_goods[iChoice].iNumber = atoi(str);
	}
}

void Czoretic::OnDropdownZoeticEquip() 
{
	// TODO: Add your control notification handler code here
	int iChoice;
	char str[10];
	iChoice = m_equip.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_equip_id_control.GetWindowText(str, 10);
		equiped[iChoice] = atoi(str);
	}
}

void Czoretic::OnZoeticNameUsed() 
{
	// TODO: Add your control notification handler code here
	if(GetDlgItem(IDC_ZOETIC_NAME)->IsWindowEnabled())
	{
		GetDlgItem(IDC_ZOETIC_NAME)->EnableWindow(FALSE);
		GetDlgItem(IDC_ZOETIC_NAME_STATIC)->EnableWindow(FALSE);
	}
	else
	{
		GetDlgItem(IDC_ZOETIC_NAME)->EnableWindow(TRUE);
		GetDlgItem(IDC_ZOETIC_NAME_STATIC)->EnableWindow(TRUE);
	}
}

void Czoretic::OnOK() 
{
	// TODO: Add extra validation here
	int iChoice;
	char str[10];
	iChoice = m_skill.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_skill_id_control.GetWindowText(str, 10);
		skill[iChoice].id = atoi(str);
		m_skill_level_control.GetWindowText(str, 10);
		skill[iChoice].level = atoi(str);
	}
	iChoice = m_goods.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_goods_id_control.GetWindowText(str, 10);
		medica_goods[iChoice].id = atoi(str);
		m_goods_number_control.GetWindowText(str, 10);
		medica_goods[iChoice].iNumber = atoi(str);
	}
	iChoice = m_equip.GetCurSel( );
	if(iChoice != CB_ERR)
	{
		m_equip_id_control.GetWindowText(str, 10);
		equiped[iChoice] = atoi(str);
	}
	CDialog::OnOK();
}